﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PwdMgr.CommonContract;
using PwdMgr.PwdMgrService.Sessions;

namespace PwdMgr.PwdMgrService.UserAuthentication
{
    public interface IAuth
    {
        /// <summary>
        /// When user login, we should create a session for a few minutes.
        /// </summary>
        /// <param name="username"></param>
        /// <param name="password"></param>
        /// <returns>User ID</returns>
        /// <exception cref="InvalidUsernamePasswordException"></exception>
        int Login(string username, string password);

        /// <summary>
        /// Create a user according to the given information.
        /// </summary>
        /// <exception cref="UserAlreadyExistException"></exception>
        /// <param name="userInfo"></param>
        void CreateUser(UserInfo userInfo);
    }
}
